package org.easy.baiducensor.enums;

import lombok.Getter;

@Getter
public enum AuditResultType {
    COMPLIANT(1, "合规"),
    NON_COMPLIANT(2, "不合规"),
    SUSPECTED(3, "疑似"),
    AUDIT_FAILED(4, "审核失败");

    private final int code;
    private final String description;

    AuditResultType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static AuditResultType formCode(int code) {
        for (AuditResultType type : AuditResultType.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid code: " + code);
    }
}
